<?php

namespace App\Http\Requests\Backend\Setting;

use Illuminate\Foundation\Http\FormRequest;

class SettingLoanRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'blacklist' => 'numeric',
            'loan_range' => 'json',
            'period_range' => 'json',
            'receipt_time_one' => 'numeric',
            'receipt_time_two' => 'numeric',
        ];
    }

    public function messages()
    {
        return [
            'blacklist.number' => '失败时间间隔为数字',
            'loan_range.json' => '取值范围为json格式',
            'period_range.json' => '期限范围为json格式',
            'receipt_time_one.number' => '返款时限1为数字',
            'receipt_time_two.number' => '返款时限1为数字'
        ];
    }
}
